﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using ExtensionMethods;
using SMDB_Connect.SMDB;

namespace GS_OM.WebServices
{
    public class UnityWebService : IUnityWebService
    {
        public List<DBOPush> GetPushByID(string id)
        {
            SMDB_Mgr mgr=new SMDB_Mgr();
            List<DBOPush> push = mgr.GetPushByID(id);
            DBOPush[] tmp = push.ToArray();
            for (int i = 0; i < tmp.Length; i++)
            {
                tmp[i] = tmp[i].TrimStringProperties();
                //if (tmp[i].Push_Active == DBOPush.ActiveStatus.DeActed.ToString())
                //{
                //    tmp[i] = null;
                //}
            }
            return tmp.ToList().OrderByDescending(o=>o.Push_ID).ToList();
        }

        public List<DBOPushRes> GetResByPushID(string id)
        {
            SMDB_Mgr mgr=new SMDB_Mgr();
            return mgr.GetResByPush(id);
        }

        public List<DBOStore> GetAllStore()
        {
            SMDB_Mgr mgr=new SMDB_Mgr();
            return mgr.GetAllStore();
        }

        public DBOStore GetStoreByAcc(string id)
        {
            SMDB_Mgr mgr=new SMDB_Mgr();
            return mgr.GetStoreByAcc(id);
        }
    }
}
